import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.core.io.ClassPathResource;

public class Test {

    public static void main(String[] args) {
        //1.获取 Spring 上下⽂对象
        ApplicationContext context=new ClassPathXmlApplicationContext("spring-config.xml");
        //2.获取Bean对象
        User user= context.getBean("user",User.class);
        //3.使用Bean对象
        System.out.println(user.Hello());
    }
}
